import 'package:miaowu/app/common/window_pop/public_btn_tem.dart';

class MemberConfigData {
  Sec1? sec1;
  Sec2? sec2;
  Sec3? sec3;
  Sec41? sec41;
  Sec42? sec42;
  Sec5? sec5;

  MemberConfigData({this.sec1, this.sec2, this.sec3, this.sec41, this.sec42, this.sec5});

  MemberConfigData.fromJson(Map<String, dynamic> json) {
    if (json["sec1"] is Map) {
      sec1 = json["sec1"] == null ? null : Sec1.fromJson(json["sec1"]);
    }
    if (json["sec2"] is Map) {
      sec2 = json["sec2"] == null ? null : Sec2.fromJson(json["sec2"]);
    }
    if (json["sec3"] is Map) {
      sec3 = json["sec3"] == null ? null : Sec3.fromJson(json["sec3"]);
    }
    if (json["sec41"] is Map) {
      sec41 = json["sec41"] == null ? null : Sec41.fromJson(json["sec41"]);
    }
    if (json["sec42"] is Map) {
      sec42 = json["sec42"] == null ? null : Sec42.fromJson(json["sec42"]);
    }
    if (json["sec5"] is Map) {
      sec5 = json["sec5"] == null ? null : Sec5.fromJson(json["sec5"]);
    }
  }

  static List<MemberConfigData> fromList(List<Map<String, dynamic>> list) {
    return list.map(MemberConfigData.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    if (sec1 != null) {
      json["sec1"] = sec1?.toJson();
    }
    if (sec2 != null) {
      json["sec2"] = sec2?.toJson();
    }
    if (sec3 != null) {
      json["sec3"] = sec3?.toJson();
    }
    if (sec41 != null) {
      json["sec41"] = sec41?.toJson();
    }
    if (sec42 != null) {
      json["sec42"] = sec42?.toJson();
    }
    if (sec5 != null) {
      json["sec5"] = sec5?.toJson();
    }
    return json;
  }

  MemberConfigData copyWith({
    Sec1? sec1,
    Sec2? sec2,
    Sec3? sec3,
    Sec41? sec41,
    Sec42? sec42,
    Sec5? sec5,
  }) =>
      MemberConfigData(
        sec1: sec1 ?? this.sec1,
        sec2: sec2 ?? this.sec2,
        sec3: sec3 ?? this.sec3,
        sec41: sec41 ?? this.sec41,
        sec42: sec42 ?? this.sec42,
        sec5: sec5 ?? this.sec5,
      );
}

class Sec5 {
  int? view;
  String? title;
  List<PublicBtnItem>? btns;

  Sec5({this.view, this.title, this.btns});

  Sec5.fromJson(Map<String, dynamic> json) {
    if (json["view"] is num) {
      view = (json["view"] as num).toInt();
    }
    if (json["title"] is String) {
      title = json["title"];
    }
    if (json["btns"] is List) {
      btns = json["btns"] == null ? null : (json["btns"] as List).map((e) => PublicBtnItem.fromJson(e)).toList();
    }
  }

  static List<Sec5> fromList(List<Map<String, dynamic>> list) {
    return list.map(Sec5.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["view"] = view;
    json["title"] = title;
    if (btns != null) {
      json["btns"] = btns?.map((e) => e.toJson()).toList();
    }
    return json;
  }

  Sec5 copyWith({
    int? view,
    String? title,
    List<PublicBtnItem>? btns,
  }) =>
      Sec5(
        view: view ?? this.view,
        title: title ?? this.title,
        btns: btns ?? this.btns,
      );
}

// class Btns1 {
//   String? key;
//   String? title;
//   int? view;
//   dynamic display;
//   Click1? click;

//   Btns1({this.key, this.title, this.view, this.display, this.click});

//   Btns1.fromJson(Map<String, dynamic> json) {
//     if (json["key"] is String) {
//       key = json["key"];
//     }
//     if (json["title"] is String) {
//       title = json["title"];
//     }
//     if (json["view"] is num) {
//       view = (json["view"] as num).toInt();
//     }
//     display = json["display"];
//     if (json["click"] is Map) {
//       click = json["click"] == null ? null : Click1.fromJson(json["click"]);
//     }
//   }

//   static List<Btns1> fromList(List<Map<String, dynamic>> list) {
//     return list.map(Btns1.fromJson).toList();
//   }

//   Map<String, dynamic> toJson() {
//     final Map<String, dynamic> json = <String, dynamic>{};
//     json["key"] = key;
//     json["title"] = title;
//     json["view"] = view;
//     json["display"] = display;
//     if (click != null) {
//       json["click"] = click?.toJson();
//     }
//     return json;
//   }

//   Btns1 copyWith({
//     String? key,
//     String? title,
//     int? view,
//     dynamic display,
//     Click1? click,
//   }) =>
//       Btns1(
//         key: key ?? this.key,
//         title: title ?? this.title,
//         view: view ?? this.view,
//         display: display ?? this.display,
//         click: click ?? this.click,
//       );
// }

class Click1 {
  String? react;
  String? jump;

  Click1({this.react, this.jump});

  Click1.fromJson(Map<String, dynamic> json) {
    if (json["react"] is String) {
      react = json["react"];
    }
    if (json["jump"] is String) {
      jump = json["jump"];
    }
  }

  static List<Click1> fromList(List<Map<String, dynamic>> list) {
    return list.map(Click1.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["react"] = react;
    json["jump"] = jump;
    return json;
  }

  Click1 copyWith({
    String? react,
    String? jump,
  }) =>
      Click1(
        react: react ?? this.react,
        jump: jump ?? this.jump,
      );
}

class Sec42 {
  int? view;
  String? title;

  Sec42({this.view, this.title});

  Sec42.fromJson(Map<String, dynamic> json) {
    if (json["view"] is num) {
      view = (json["view"] as num).toInt();
    }
    if (json["title"] is String) {
      title = json["title"];
    }
  }

  static List<Sec42> fromList(List<Map<String, dynamic>> list) {
    return list.map(Sec42.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["view"] = view;
    json["title"] = title;
    return json;
  }

  Sec42 copyWith({
    int? view,
    String? title,
  }) =>
      Sec42(
        view: view ?? this.view,
        title: title ?? this.title,
      );
}

class Sec41 {
  int? view;
  List<PayChannels>? payChannels;
  List<PublicBtnItem>? btns;

  Sec41({this.view, this.payChannels, this.btns});

  Sec41.fromJson(Map<String, dynamic> json) {
    if (json["view"] is num) {
      view = (json["view"] as num).toInt();
    }
    if (json["payChannels"] is List) {
      payChannels = json["payChannels"] == null
          ? null
          : (json["payChannels"] as List).map((e) => PayChannels.fromJson(e)).toList();
    }
    if (json["btns"] is List) {
      btns = json["btns"] == null ? null : (json["btns"] as List).map((e) => PublicBtnItem.fromJson(e)).toList();
    }
  }

  static List<Sec41> fromList(List<Map<String, dynamic>> list) {
    return list.map(Sec41.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["view"] = view;
    if (payChannels != null) {
      json["payChannels"] = payChannels?.map((e) => e.toJson()).toList();
    }
    if (btns != null) {
      json["btns"] = btns?.map((e) => e.toJson()).toList();
    }
    return json;
  }

  Sec41 copyWith({
    int? view,
    List<PayChannels>? payChannels,
    List<PublicBtnItem>? btns,
  }) =>
      Sec41(
        view: view ?? this.view,
        payChannels: payChannels ?? this.payChannels,
        btns: btns ?? this.btns,
      );
}

// class Btns {
//   String? key;
//   String? title;
//   int? view;
//   dynamic display;
//   Click? click;

//   Btns({this.key, this.title, this.view, this.display, this.click});

//   Btns.fromJson(Map<String, dynamic> json) {
//     if (json["key"] is String) {
//       key = json["key"];
//     }
//     if (json["title"] is String) {
//       title = json["title"];
//     }
//     if (json["view"] is num) {
//       view = (json["view"] as num).toInt();
//     }
//     display = json["display"];
//     if (json["click"] is Map) {
//       click = json["click"] == null ? null : Click.fromJson(json["click"]);
//     }
//   }

//   static List<Btns> fromList(List<Map<String, dynamic>> list) {
//     return list.map(Btns.fromJson).toList();
//   }

//   Map<String, dynamic> toJson() {
//     final Map<String, dynamic> json = <String, dynamic>{};
//     json["key"] = key;
//     json["title"] = title;
//     json["view"] = view;
//     json["display"] = display;
//     if (click != null) {
//       json["click"] = click?.toJson();
//     }
//     return json;
//   }

//   Btns copyWith({
//     String? key,
//     String? title,
//     int? view,
//     dynamic display,
//     Click? click,
//   }) =>
//       Btns(
//         key: key ?? this.key,
//         title: title ?? this.title,
//         view: view ?? this.view,
//         display: display ?? this.display,
//         click: click ?? this.click,
//       );
// }

class Click {
  String? react;
  String? option;

  Click({this.react, this.option});

  Click.fromJson(Map<String, dynamic> json) {
    if (json["react"] is String) {
      react = json["react"];
    }
    if (json["option"] is String) {
      option = json["option"];
    }
  }

  static List<Click> fromList(List<Map<String, dynamic>> list) {
    return list.map(Click.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["react"] = react;
    json["option"] = option;
    return json;
  }

  Click copyWith({
    String? react,
    String? option,
  }) =>
      Click(
        react: react ?? this.react,
        option: option ?? this.option,
      );
}

class PayChannels {
  int? chnId;
  String? chnKind;
  String? chnJump;
  String? chnName;
  List<dynamic>? extra;

  PayChannels({this.chnId, this.chnKind, this.chnJump, this.chnName, this.extra});

  PayChannels.fromJson(Map<String, dynamic> json) {
    if (json["chn_id"] is num) {
      chnId = (json["chn_id"] as num).toInt();
    }
    if (json["chn_kind"] is String) {
      chnKind = json["chn_kind"];
    }
    if (json["chn_jump"] is String) {
      chnJump = json["chn_jump"];
    }
    if (json["chn_name"] is String) {
      chnName = json["chn_name"];
    }
    if (json["extra"] is List) {
      extra = json["extra"] ?? [];
    }
  }

  static List<PayChannels> fromList(List<Map<String, dynamic>> list) {
    return list.map(PayChannels.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["chn_id"] = chnId;
    json["chn_kind"] = chnKind;
    json["chn_jump"] = chnJump;
    json["chn_name"] = chnName;
    if (extra != null) {
      json["extra"] = extra;
    }
    return json;
  }

  PayChannels copyWith({
    int? chnId,
    String? chnKind,
    String? chnJump,
    String? chnName,
    List<dynamic>? extra,
  }) =>
      PayChannels(
        chnId: chnId ?? this.chnId,
        chnKind: chnKind ?? this.chnKind,
        chnJump: chnJump ?? this.chnJump,
        chnName: chnName ?? this.chnName,
        extra: extra ?? this.extra,
      );
}

class Sec3 {
  int? view;
  List<VipRights>? vipRights;

  Sec3({this.view, this.vipRights});

  Sec3.fromJson(Map<String, dynamic> json) {
    if (json["view"] is num) {
      view = (json["view"] as num).toInt();
    }
    if (json["vipRights"] is List) {
      vipRights =
          json["vipRights"] == null ? null : (json["vipRights"] as List).map((e) => VipRights.fromJson(e)).toList();
    }
  }

  static List<Sec3> fromList(List<Map<String, dynamic>> list) {
    return list.map(Sec3.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["view"] = view;
    if (vipRights != null) {
      json["vipRights"] = vipRights?.map((e) => e.toJson()).toList();
    }
    return json;
  }

  Sec3 copyWith({
    int? view,
    List<VipRights>? vipRights,
  }) =>
      Sec3(
        view: view ?? this.view,
        vipRights: vipRights ?? this.vipRights,
      );
}

class VipRights {
  int? id;
  String? rightName;
  String? unvipDesc;
  String? vipDesc;
  String? rightKey;

  VipRights({this.id, this.rightName, this.unvipDesc, this.vipDesc, this.rightKey});

  VipRights.fromJson(Map<String, dynamic> json) {
    if (json["id"] is num) {
      id = (json["id"] as num).toInt();
    }
    if (json["right_name"] is String) {
      rightName = json["right_name"];
    }
    if (json["unvip_desc"] is String) {
      unvipDesc = json["unvip_desc"];
    }
    if (json["vip_desc"] is String) {
      vipDesc = json["vip_desc"];
    }
    if (json["right_key"] is String) {
      rightKey = json["right_key"];
    }
  }

  static List<VipRights> fromList(List<Map<String, dynamic>> list) {
    return list.map(VipRights.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["id"] = id;
    json["right_name"] = rightName;
    json["unvip_desc"] = unvipDesc;
    json["vip_desc"] = vipDesc;
    json["right_key"] = rightKey;
    return json;
  }

  VipRights copyWith({
    int? id,
    String? rightName,
    String? unvipDesc,
    String? vipDesc,
    String? rightKey,
  }) =>
      VipRights(
        id: id ?? this.id,
        rightName: rightName ?? this.rightName,
        unvipDesc: unvipDesc ?? this.unvipDesc,
        vipDesc: vipDesc ?? this.vipDesc,
        rightKey: rightKey ?? this.rightKey,
      );
}

class Sec2 {
  int? view;
  List<VipOptions>? vipOptions;

  Sec2({this.view, this.vipOptions});

  Sec2.fromJson(Map<String, dynamic> json) {
    if (json["view"] is num) {
      view = (json["view"] as num).toInt();
    }
    if (json["vipOptions"] is List) {
      vipOptions =
          json["vipOptions"] == null ? null : (json["vipOptions"] as List).map((e) => VipOptions.fromJson(e)).toList();
    }
  }

  static List<Sec2> fromList(List<Map<String, dynamic>> list) {
    return list.map(Sec2.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["view"] = view;
    if (vipOptions != null) {
      json["vipOptions"] = vipOptions?.map((e) => e.toJson()).toList();
    }
    return json;
  }

  Sec2 copyWith({
    int? view,
    List<VipOptions>? vipOptions,
  }) =>
      Sec2(
        view: view ?? this.view,
        vipOptions: vipOptions ?? this.vipOptions,
      );
}

class VipOptions {
  int? vipid;
  int? gender;
  String? vipName;
  int? vipValidkind;
  String? priceOrigStr;
  String? priceStr;
  int? price;
  int? discount;
  String? iosId;
  int? ifRecom;
  int? ifDef;

  VipOptions(
      {this.vipid,
      this.gender,
      this.vipName,
      this.vipValidkind,
      this.priceOrigStr,
      this.priceStr,
      this.price,
      this.discount,
      this.iosId,
      this.ifRecom,
      this.ifDef});

  VipOptions.fromJson(Map<String, dynamic> json) {
    if (json["vipid"] is num) {
      vipid = (json["vipid"] as num).toInt();
    }
    if (json["gender"] is num) {
      gender = (json["gender"] as num).toInt();
    }
    if (json["vip_name"] is String) {
      vipName = json["vip_name"];
    }
    if (json["vip_validkind"] is num) {
      vipValidkind = (json["vip_validkind"] as num).toInt();
    }
    if (json["priceOrigStr"] is String) {
      priceOrigStr = json["priceOrigStr"];
    }
    if (json["priceStr"] is String) {
      priceStr = json["priceStr"];
    }
    if (json["price"] is num) {
      price = (json["price"] as num).toInt();
    }
    if (json["discount"] is num) {
      discount = (json["discount"] as num).toInt();
    }
    if (json["ios_id"] is String) {
      iosId = json["ios_id"];
    }
    if (json["if_recom"] is num) {
      ifRecom = (json["if_recom"] as num).toInt();
    }
    if (json["if_def"] is num) {
      ifDef = (json["if_def"] as num).toInt();
    }
  }

  static List<VipOptions> fromList(List<Map<String, dynamic>> list) {
    return list.map(VipOptions.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["vipid"] = vipid;
    json["gender"] = gender;
    json["vip_name"] = vipName;
    json["vip_validkind"] = vipValidkind;
    json["priceOrigStr"] = priceOrigStr;
    json["priceStr"] = priceStr;
    json["price"] = price;
    json["discount"] = discount;
    json["ios_id"] = iosId;
    json["if_recom"] = ifRecom;
    json["if_def"] = ifDef;
    return json;
  }

  VipOptions copyWith({
    int? vipid,
    int? gender,
    String? vipName,
    int? vipValidkind,
    String? priceOrigStr,
    String? priceStr,
    int? price,
    int? discount,
    String? iosId,
    int? ifRecom,
    int? ifDef,
  }) =>
      VipOptions(
        vipid: vipid ?? this.vipid,
        gender: gender ?? this.gender,
        vipName: vipName ?? this.vipName,
        vipValidkind: vipValidkind ?? this.vipValidkind,
        priceOrigStr: priceOrigStr ?? this.priceOrigStr,
        priceStr: priceStr ?? this.priceStr,
        price: price ?? this.price,
        discount: discount ?? this.discount,
        iosId: iosId ?? this.iosId,
        ifRecom: ifRecom ?? this.ifRecom,
        ifDef: ifDef ?? this.ifDef,
      );
}

class Sec1 {
  int? view;
  int? id;
  String? accid;
  int? gender;
  String? avatar;
  String? nickname;
  Params? params;

  Sec1({this.view, this.id, this.accid, this.gender, this.avatar, this.nickname, this.params});

  Sec1.fromJson(Map<String, dynamic> json) {
    if (json["view"] is num) {
      view = (json["view"] as num).toInt();
    }
    if (json["id"] is num) {
      id = (json["id"] as num).toInt();
    }
    if (json["accid"] is String) {
      accid = json["accid"];
    }
    if (json["gender"] is num) {
      gender = (json["gender"] as num).toInt();
    }
    if (json["avatar"] is String) {
      avatar = json["avatar"];
    }
    if (json["nickname"] is String) {
      nickname = json["nickname"];
    }
    if (json["params"] is Map) {
      params = json["params"] == null ? null : Params.fromJson(json["params"]);
    }
  }

  static List<Sec1> fromList(List<Map<String, dynamic>> list) {
    return list.map(Sec1.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["view"] = view;
    json["id"] = id;
    json["accid"] = accid;
    json["gender"] = gender;
    json["avatar"] = avatar;
    json["nickname"] = nickname;
    if (params != null) {
      json["params"] = params?.toJson();
    }
    return json;
  }

  Sec1 copyWith({
    int? view,
    int? id,
    String? accid,
    int? gender,
    String? avatar,
    String? nickname,
    Params? params,
  }) =>
      Sec1(
        view: view ?? this.view,
        id: id ?? this.id,
        accid: accid ?? this.accid,
        gender: gender ?? this.gender,
        avatar: avatar ?? this.avatar,
        nickname: nickname ?? this.nickname,
        params: params ?? this.params,
      );
}

class Params {
  String? vipdesc;

  Params({this.vipdesc});

  Params.fromJson(Map<String, dynamic> json) {
    if (json["vipdesc"] is String) {
      vipdesc = json["vipdesc"];
    }
  }

  static List<Params> fromList(List<Map<String, dynamic>> list) {
    return list.map(Params.fromJson).toList();
  }

  Map<String, dynamic> toJson() {
    final Map<String, dynamic> json = <String, dynamic>{};
    json["vipdesc"] = vipdesc;
    return json;
  }

  Params copyWith({
    String? vipdesc,
  }) =>
      Params(
        vipdesc: vipdesc ?? this.vipdesc,
      );
}
